import TJavaLib.TList;
import TJavaLib.TPoint;

public class TNode {
	public static final byte SENSOR = 1;
	public static final byte GATEWAY = 2;
	
	private byte nodeType;
		
	protected TPoint loc;
	protected TRadio radio;
	protected TSenInf seninf;
	protected TDeco deco;
	
	public TNode(byte nodeType) {
		this.nodeType = nodeType;
		radio = new TRadio();
		seninf = new TSenInf();
		deco = new TDeco();
	}
	
	public byte getNodeType() { return nodeType; }
	public TRadio getRadio() { return radio; }
	public TSenInf getSenInf() { return seninf; }
	public TPoint getLoc() { return loc; }
	public void setLoc(TPoint loc) { this.loc = loc; }
	public void setLoc(double x, double y) { this.loc = new TPoint(x, y); }
	public TDeco getDeco() { return deco; }
	
	public boolean inMe(TPoint p) {
		return TPoint.dist(loc, p) <= deco.radius;
	}
}
